#include <stdio.h>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <list>
#include <set>

int main ()
{
    FILE *fp = fopen ("num", "rt");
    int d = 0;
    std::list<int> num_list;
    while (fscanf (fp, "%d\n", &d) != EOF)
    {
	num_list.push_back (d);
    }
    fclose(fp);
    //
    num_list.sort ();
    std::list<int>::iterator pos;
    std::set<int> lost_set;
    register int max = -1;
    pos = num_list.begin();
    max = *pos;
    for (register int n = 0; n < max; ++n)
	lost_set.insert(n);
    pos++;
    for (; pos != num_list.end(); ++pos)
    {
	if (max < *pos)
	{

	    for (register int n = max+1; n < *pos; ++n)
		lost_set.insert(n);
	    max = *pos;
	}else
	{
	    lost_set.erase(*pos);
	}
    }
    std::copy(lost_set.begin(), lost_set.end(), std::ostream_iterator<int>(std::cout, "\n"));
}
